import requests
import json
import re

url = "http://www.7799520.com/api/user/pc/list/search?gender=2&marry=1&page=1"
# pattern1 = r'http:\/\/www\.7799520\.com\/api\/user\/pc\/list\/search\?gender=2&marry=1&page=1'
# a=re.compile(pattern1).findall(url)
# print(a)
DEFAULT_REQUEST_HEADERS = {
  'Accept': 'application/json, text/javascript, */*; q=0.01',
  'Accept-Encoding': 'gzip, deflate',
  'Accept-Language': 'zh-CN,zh;q=0.9',
  'Connection': 'keep-alive',
  #'Cookie': 'Hm_lvt_ee0de768b7db1b355930288073352dbe=1556760034; 59167___602875_KS_59167___602875=86e65a142b40477f8c314ef60e8d8401; 59167___602875_KS_ri_ses=19008208180%7C5FD357CFC9B98315EFCC15EDAE3EE4AD-null; PHPSESSID=v0cl1cj7l84dd5k3jdd7pm5is2; Hm_lpvt_ee0de768b7db1b355930288073352dbe=1556763302; 59167___602875_curPageNum=44; 59167___602875_curRanId=1556763563691_1556763302919; 59167___602875_curPage_1556763302919=44_true_1556763563692; 59167___602875_curPage_1556762530198=43_true_1556763564324',
  'Host': 'www.7799520.com',
  'Referer': 'http://www.7799520.com/jiaoyou.html',
  #'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36',
  'X-Requested-With': 'XMLHttpRequest'
}

req = requests.get("http://www.7799520.com/api/user/pc/list/search?gender=1&marry=1&page=1").text
# with open("male.jpg",'wb') as f:
#     f.write(req.content)

data = json.loads(req)
# print(data['data']['list'])
for i in data['data']['list']:
    print(i)